import type { NextApiResponse } from 'next';
import * as categoryService from '@/common/service/g_category';
import { AuthenticatedRequest, withAuth } from '@common/middleware/auth';
import R from '@common/type/response';

export async function handler(req: AuthenticatedRequest, res: NextApiResponse) {
  // 返回全部分类，不分页
  const data = await categoryService.getCategoryList({}, 0, 1000);
  R.success(res, data);
} 

export default withAuth(handler); 